package pers.liyan.shi.springboot.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import pers.liyan.shi.springboot.bean.Department;
import pers.liyan.shi.springboot.service.DepartmentService;

@RestController
public class DepartmentController {

    @Autowired
    private DepartmentService service;

    @GetMapping("/dept/{id}")
    public Department getDeptById(@PathVariable("id") Integer id){
        return service.getDeptById(id);
    }

}
